package com.example.test;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.test.suppert.BaseDo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.Column;
import javax.persistence.Entity;
import java.util.Date;

/**
 * Created by lsl on 2021/3/5.
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@SuperBuilder
@Entity(name = "jpa_course")
@TableName("jpa_course")
public class CourseDo extends BaseDo {

    @TableField("course_name")
    @Column(columnDefinition = "varchar(50) comment '课程名称'")
    private String courseName;

    @TableField("score")
    @Column(columnDefinition = "int comment '分数'")
    private Integer score;

    @TableField("user_id")
    @Column(columnDefinition = "bigint comment '用户id'")
    private Long userId;

    @TableField("exam_date")
    @Column(columnDefinition = "date comment '考试日期'")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date examDate;
}
